Skip to content

ID-45: Session CLI and Scripted Execution#111

Merged
karlnaden merged 11 commits intomainfrom
id45-session-cli-and-script-execution
Apr 16, 2026
Merged

ID-45: Session CLI and Scripted Execution#111
karlnaden merged 11 commits intomainfrom
id45-session-cli-and-script-execution

Conversation

@karlnaden
Copy link
Copy Markdown
Contributor

Summary

This PR documents the significant new features added in Core PR 760. Documenting how to use the features.

Updated pages include (links to localhost)

Testing Guidance

Render the content locally and check the rendered pages for

  • inaccuracies
  • broken links, except for
    • the examples which may point to content in PRs (here, here, here, and here) in the target test kits)
    • pointers to generated class documentation for core classes for new methods and entities

@karlnaden karlnaden requested a review from ljtucker April 10, 2026 16:29
**Options**:
- `-I`, `--inferno_base_url`: URL of the target Inferno service.

**Output**: JSON array of objects with `name` and `value` keys representing the session's current inputs.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THis section seems to be about the session data and the next section is about results, but the hyperlink here is for results and the next is for session data -- they seem flipped

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for catching that.

- `-s`, `--expected_results_session`: Session ID on the same server. The results of this indicated
session will be used as the expected results. When the compared session's results do not match
comparison details will not be written to file (use the `-f` option).
- `-m`, `--compare_messages`: Also compare per-test messages (not only pass/fail result). Default: `false`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at your most recent PR, I think --compare_messages and --compare_result_message actually default to true now, not false

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They default to true when the execute_script CLI command uses session compare, but not when directly calling the CLI command. So I think this is correct as is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matches: ^There is a problem with the terminology resources
```

Note that the `normalized_string:` key never appears under the `sessions:` key.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normalized_strings (with an s)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

started by this script. The following sub keys are used.
- `runnable:` *Required* - the test, group, or suite to execute, specified as a short ID
from the UI or an internal id.
- `inputs:` *Optional* - key-value pairs indicating inputs to be merged into those already
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the comment for inputs in the inferno core repo, you mention two ways to define inputs:

# input_name: "value" # for the input
# input_name: "@path/to/file.txt" # prefix value with @ to read from a file;
# # relative paths are resolved from the
# # directory containing this script file

Should these two methods be listed here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, and there's actually another possibility - objects or sequences that get serialized to json. Added both here and added the object/sequence option to the core documentation.


The `--implementation-guide` or `-i` option will look at an absolute file path if its prefixed by `file:///` or lookup the name in the [official FHIR package registry](https://packages.fhir.org/).

## Manage Sessions
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran this section through claude to see if it identified any significant gaps in what was defined in this doc vs what options developed have, and it pointed out that there is no documentation at all of the "planned failure" tests, with the _failure naming convention. It details:

_failure script naming convention is undocumented

Neither the scripting doc nor the CI/CD doc mentions that scripts whose filename contains _failure receive special treatment. There are now two pass conditions for a _failure script:

Script exits non-zero and "Actual results matched expected results? true" appears in output.
Script exits non-zero, output contains "errors", and the expected file doesn't exist yet (first-run bootstrap case).
A developer wanting to add a known-bad regression test has no guidance anywhere on any of this.

_failure scripts not handled in the template workflow or template Rakefile

The template workflow (run_inferno_execution_scripts.yml) and the template Rakefile.tt — what new test kits actually get — have no special logic for _failure scripts. A _failure script added to a test kit generated from the template will simply fail CI. The CI/CD doc says "all executed scripts are expected to complete successfully" with no caveat, so this gap is invisible to users.

Meanwhile, the inferno-core Rakefile passes allow_known_failures: true but the template's does not, meaning bundle exec rake execute_scripts:run_all behaves differently in inferno-core vs. a generated test kit — also undocumented.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally put the failure handling into core, but not the test kits because

  1. In core, we need to be able to test the scripting infrastructure itself including catching failures.
  2. In test kits, a "failure" in the sense used here should never be expected. Failures are purple errors and misconfigured scripts.

Based on that, this complexity is not needed for test kits and so doesn't need to be documented here since this isn't supposed to be targeted at inferno-core developers. However, I will add a readme file to the execution_scripts directory in core that explains the failure handling there so that core developers can find that information.

Copy link
Copy Markdown
Contributor Author

@karlnaden karlnaden Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a README.md file in core

@karlnaden karlnaden requested a review from ljtucker April 13, 2026 12:54
@karlnaden karlnaden merged commit a364cb5 into main Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants